import request from '@/utils/request'
import log from '@/utils/log'

export function login(data) {
  log("group","前端发送请求","POST/_____")
  log("info","URL:","http://localhost:8080/_____")
    // 发起异步的ajax请求，向后端服务器请求数据
  log("info","参数:",data)
  return request({
    url: 'http://localhost:8080/_____',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  log("group","前端发送请求","GET/(getInfo)")
  log("info","URL:","/vue-admin-template/user/info")
    // 发起异步的ajax请求，向后端服务器请求数据
  log("info","参数:",token)
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  log("group","前端发送请求","POST/(logout)")
  log("info","URL:","/vue-admin-template/user/logout")
    // 发起异步的ajax请求，向后端服务器请求数据
  log("info","参数:","unset")
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
